﻿using Microsoft.AspNetCore.Mvc;
using 并发处理.Datas;
using 并发处理.Filter;

namespace 并发处理.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class CompanyController : ControllerBase
    {
        [HttpGet(nameof(FindById))]
        [ETagFilter]
         public IActionResult FindById([FromQuery]int id)
        {
            return  Ok( CompanyRepository.FindById(id));
        }


        [HttpPut(nameof(Update))]
        [ETagFilter]
        public IActionResult Update([FromBody] Company company)
        {
            return Ok(CompanyRepository.Update(company));
        }
    }
}
